import React from 'react'

import { connect } from 'react-redux';

class Home extends React.Component{

    handleTakeEvery=()=>{
        this.props.dispatch({
            type:'takeEvery',
            user:{
                username:"zs",
                password:"123"
            }
        })
    }
    handleTakeLatest=()=>{
        this.props.dispatch({
            type:'takeLatest',
            user:{
                username:"zs",
                password:"123"
            }
        })
    }
    handleThrottle=()=>{
        this.props.dispatch({
            type:'throttle',
            user:{
                username:"zs",
                password:"123"
            }
        })
    }
    handleFork =()=>{
        this.props.dispatch({
            type:'fork'
        })
    }
    render(){
        return (
            <div>
                <button onClick={this.handleTakeEvery}>点击发送takeEvery</button>
                <button onClick={this.handleTakeLatest}>点击发送takeLatest</button>
                <button onClick={this.handleThrottle}>点击发送throttle</button>
                <button onClick={this.handleFork}>开始计数测试fork</button>
            </div>
        )
    }

}

export default connect()(Home)